package com.ws.dao;

import com.ws.bean.Depart;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface DepartDao {


    @Select("select * from depart where dstatus = #{dstatus}")
    List<Depart> findByStatus(String dstatus);

    @Insert("insert into depart values(null, #{dname}, #{duty}, now(), 0)")
    void addDepart(@Param("dname") String dname,@Param("duty") String duty);

    @Select("select * from depart where did = #{did}")
    Depart findByDid(String did);

    @Update("update depart set dname = #{dname}, duty = #{duty} where did = #{did}")
    void updateDepart(Depart depart);

    @Update("update depart set dstatus = #{dstatus} where did=#{did}")
    void updateDstatus(@Param("did") int did, @Param("dstatus") int dstatus);
}
